﻿<div bsModal #createOrEditModal="bs-modal" (onShown)="onShown()" class="modal fade" tabindex="-1" role="dialog"
    aria-labelledby="createOrEditModal" aria-hidden="true" [config]="{backdrop: 'static', keyboard: !saving}">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <form *ngIf="active" #userForm="ngForm" novalidate (ngSubmit)="save()" autocomplete="off">
                <div class="modal-header">
                    <h4 class="modal-title">
                        <span *ngIf="!editFlag">编辑</span>
                        <span *ngIf="editFlag">新建</span>
                    </h4>
                    <button type="button" class="close" (click)="close()" [attr.aria-label]="l('Close')"
                        [disabled]="saving">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <tabset class="tab-container tabbable-line">
                        <tab heading="需求包信息" customClass="m-tabs__item">
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="form-group">
                                        <label for="displayName">名称 *</label>
                                        <input id="id" class="form-control" type="text" name="id" [(ngModel)]="requirementPackage.id" hidden=true>
                                        <input id="displayName" #displayNameInput="ngModel" type="text" name="displayName" class="form-control" [(ngModel)]="requirementPackage.displayName" required  maxlength="256">
                                        <validation-messages [formCtrl]="displayNameInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="belongToModel">型号 *</label>
                                        <input id="belongToModel" #belongToModelInput="ngModel" type="text" name="belongToModel" class="form-control" [(ngModel)]="requirementPackage.usableRange.belongToModel" required  maxlength="256">
                                        <validation-messages [formCtrl]="belongToModelInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="batch">发次 *</label>
                                        <input id="batch" #batchInput="ngModel" type="text" name="batch" class="form-control" [(ngModel)]="requirementPackage.usableRange.batch" required  maxlength="256">
                                        <validation-messages [formCtrl]="batchInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                             <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="belongToComponent">所属部段 *</label>
                                        <input id="belongToComponent" #belongToComponentInput="ngModel" type="text" name="belongToComponent" class="form-control" [(ngModel)]="requirementPackage.usableRange.belongToComponent" required  maxlength="256">
                                        <validation-messages [formCtrl]="belongToComponentInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="quantityOfLaunch">批产数量 *</label>
                                        <input id="quantityOfLaunch" #quantityOfLaunchInput="ngModel" type="number" name="quantityOfLaunch" class="form-control" [(ngModel)]="requirementPackage.usableRange.quantityOfLaunch" required  maxlength="256">
                                        <validation-messages [formCtrl]="quantityOfLaunchInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="craftFileNumber">工艺文件编号 *</label>
                                        <input id="craftFileNumber" #craftFileNumberInput="ngModel" type="text" name="craftFileNumber" class="form-control" [(ngModel)]="requirementPackage.craftFileNumber" required  maxlength="256">
                                        <validation-messages [formCtrl]="craftFileNumberInput"></validation-messages>
                                    </div>
                                </div>
                                <div class="col-sm-6">
                                    <div class="form-group">
                                        <label for="firstLaunchDate">首发需求时间 *</label>
                                        <input id="firstLaunchDate" #firstLaunchDateInput="ngModel" type="text" name="firstLaunchDate" class="form-control" [(ngModel)]="requirementPackage.firstLaunchDate" bsDatepicker data-date-format="yyyy-mm-dd" required>
                                        <validation-messages [formCtrl]="firstLaunchDateInput"></validation-messages>
                                    </div>
                                </div>
                            </div>
                        </tab>
                    </tabset>
                </div>
                <div class="modal-footer">
                    <button [disabled]="saving" type="button" class="btn btn-default" (click)="close()">{{"Cancel" | localize}}</button>
                    <button *ngIf="requirementPackage.state == 0" type="submit" class="btn btn-primary" [disabled]="!userForm.form.valid" [buttonBusy]="saving" [busyText]="l('SavingWithThreeDot')"><i class="fa fa-save"></i>
                        <span>{{"Save" | localize}}</span></button>
                </div>
            </form>
        </div>
    </div>
</div>